﻿//Write a method that checks if the element at given position in given array of integers is bigger than its two neighbors (when such exist).


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CheckIfElementIsBiggerThanTwoNeighbours
{
    class CheckIfElementIsBiggerThanTwoNeighbours
    {
        static void GivenArray(int a, int[] array)
        {
            for (int i = 0; i < array.Length - 1; i++)
            {
                if (i == a)
                {
                    if (i < array.Length - 1)
                    {
                        if (array[i] > array[i + 1]) Console.WriteLine("Element {0} >Element {1}", i, (i + 1));
                        if (array[i] <= array[i + 1]) Console.WriteLine("Element {0} not >Element {1}", i, (i + 1));
                    }
                    if (i > 0)
                    {
                        if (array[i] > array[i - 1]) Console.WriteLine("Element {0} >Element {1}", i, (i - 1));
                        if (array[i] <= array[i - 1]) Console.WriteLine("Element {0} not >Element {1}", i, (i - 1));
                    }
                }
            }
        }
        static void Main()
        {
            int number = int.Parse(Console.ReadLine());
            int[] array = { 2, 1, 23, 2, 3, 3, 5, 2, 2, 1 };
            GivenArray(number, array);
        }
    }
}

